USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0003_MONTO_LIQUIDO]    Script Date: 11/28/2011 12:18:34 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0003_MONTO_LIQUIDO]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0003_MONTO_LIQUIDO]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0003_MONTO_LIQUIDO]    Script Date: 11/28/2011 12:18:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[WASP_M0003_MONTO_LIQUIDO]
AS

BEGIN
	SELECT 
			XllAosuc as aosuc, 
			XllAocta as aocta, 
			XllAooper as aooper,
			XLLCAPITAL as MTOLIQ

	INTO dbo.PrimLiq

	FROM X054023 (NOLOCK),
		 FSD010 (NOLOCK)
	     
	WHERE XllAosuc = aosuc 
	and   XllAocta = aocta 
	and   XllAooper = aooper 
	and   aosbop = 0 
	and	  aocta <> 999999999 
	and   aooper <> 999999999 
	and   aosbop = XllAosbop 
	and   XllAotop = Aotope 
	and   aomod = XllAomod

	ORDER BY XllFValor
END
GO

